import request from '@/utils/request'

export function getDeviceList(params) {
  return request({
    url: '/device/list',
    method: 'get',
    params: params
  })
}

export function addDevice(data) {
  return request({
    url: '/device/',
    method: 'post',
    data
  })
}

export function getDeviceDetail(params) {
  return request({
    url: '/device/' + params,
    method: 'get'
  })
}

export function getDeviceTotalInfo(params) {
  return request({
    url: '/device/count',
    method: 'get',
    params: params
  })
}

export function updateDeviceStatus(data) {
  return request({
    url: '/device/status',
    method: 'put',
    data
  })
}

export function updateDevice(data) {
  return request({
    url: '/device/',
    method: 'put',
    data
  })
}

export function deleteDevice(params) {
  return request({
    url: '/device/' + params,
    method: 'delete'
  })
}

export function getDeviceShadow(params) {
  return request({
    url: '/deviceshadow/' + params,
    method: 'get'
  })
}

export function updateDeviceShadow(data) {
  return request({
    url: '/deviceshadow/',
    method: 'put',
    data
  })
}

export function getReviewList(params) {
  return request({
    url: '/review/devicelist',
    method: 'get',
    params: params
  })
}

export function updateReviewStatus(data) {
  return request({
    url: '/review/status',
    method: 'put',
    data
  })
}